﻿{extend name="base" /}

{block name="css"}
  <link rel="stylesheet" href="__HCSS__/cart/cart.css">
{/block}

{block name="body"}


<div class="main-container container">
	<ul class="breadcrumb">
		<li><a href="{:url('home/index/index')}"><i class="fa fa-home"></i></a></li>
		<li><a href="#">购物车</a></li>
	</ul>

	<div class="row">
		<!-- cart-main-area start -->
		<div class="cart-main-area pt-0">
			<div class="container">
				<div class="row">
					<div class="col-md-12 col-sm-12 col-xs-12">
					{if condition="$cartInfo"}
						<form method="post" id="settlementForm" action="{:url('home/Order/index')}">
							<div class="table-content table-responsive">
								<table>
									<thead>
										<tr>
											<th width="3%">
												<input type="checkbox" id="checkbox-1" class="select_all">
												<label for="checkbox-1"></label>
											</th>
											<th >Logo</th>
											<th >商品</th>
											<th >商品规格</th>
											<th >单价</th>
											<th >数量</th>
											<th >小计</th>
											<th >删除</th>
										</tr>
									</thead>
									<tbody>
									{volist name="cartInfo" id="v"}
										<tr goods-id="{$v.goods_id}" goods-spec-key="{$v.goods_spec_key}" update-url="{:url('home/Cart/updateData')}">
											<td class="text-c" width="3%">
												<input type="checkbox" name="buythis[]" class="ic-checkbox index-chkbox" value="{$v.goods_id}:{$v.goods_spec_key}" />
											</td>
											<td class="product-thumbnail">
												<a href="#"><img src="{$v.goods_image|show_image="goods",###}" alt="" /></a>
											</td>
											<td class="product-name">
												<a href="">{$v.goods_name}</a>
											</td>
											<td class="product-spec">
												<a href="">{$v.spec_details|default="没有规格信息"}</a>
											</td>
											<td class="product-price">
												{$v.price}
											</td>
											<td class="product-quantity">
												<a href="javascript:;" class="reduce_num"><span class="glyphicon glyphicon-minus" aria-hidden="true"></span></a>
													<input type="text" name="quantity" value="{$v.quantity}" class="amount" />
												<a href="javascript:;" class="add_num"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
											</td>
											<td class="product-subtotal">
												{$v.price * $v.quantity}
											</td>
											<td class="product-remove">
												<a href="javascript:;" class="delete-btn" data-key="{$v.goods_id}:{$v.goods_spec_key}" data-id="{$v.id}" data-url="{:url('home/Cart/delToCart')}"><i class="fa fa-times"></i></a>
											</td>
										</tr>
									{/volist}
									</tbody>
								</table>
							</div>
							<div class="row">
								<div class="col-md-9 col-sm-7 col-xs-12">
									<div class="buttons-cart">
										<a href="{:url('home/Cart/index')}">刷新</a>
										<input type="button" class="delete-all" data-url="{:url('home/Cart/emptyCart')}" value="清空购物车" />
										<a href="{:url('home/Index/index')}">继续购物</a>
									</div>
								</div>
								<div class="col-md-3 col-sm-5 col-xs-12">
									<div class="cart_totals">
										<table>
											<tbody>
												<tr class="order-total">
													<th>总价</th>
													<td>
														<strong><span id="total" class="amount">0</span></strong>
													</td>
												</tr>
											</tbody>
										</table>
										<div class="wc-proceed-to-checkout">
											<a href="javascript:;" class="submit-btn">结算</a>
										</div>
									</div>
								</div>
							</div>
						</form>	
						{else /}
							<div class="row">
								<div class="col-md-9 col-sm-7 col-xs-12">
									<div class="buttons-cart">
									<h3>购物车内暂时没有商品！</h3>
										<a href="{:url('home/Cart/index')}">刷新</a>
										<a href="{:url('home/Index/index')}">去购物</a>
										{if condition="$Think.session.user_id"}
										{else/}
											<a href="{:url('home/Login/index')}">登陆</a>
										{/if}
									</div>
								</div>
							</div>
						{/if}
					</div>
				</div>
			</div>
		</div>
		<!-- cart-main-area end -->	
		<div>&nbsp;</div>

	</div>
</div>
<!-- //Main Container -->



{/block}

{block name="script"}
	<script type="text/javascript" src="__HJS__/cart/cart.js"></script>
{/block}